const path = require('path')

const fpath = 'a/b/c/d/index.html'

// 获取路径中的文件名
const fullName = path.basename(fpath)
console.log(fullName);

const nameWithoutExt = path.basename(fpath,'.html')
console.log(nameWithoutExt);

const extName = path.extname(fpath)
console.log(extName);
